global a0
myfun3 = @(x) a0(3) + a0(2).*x + a0(1).*x.*x;
figure(1); % 2D Surface plot

%set(gca,'yLim',[0.1 1]);
%set(gca,'xLim',[0 11]);
set(gca,'XTick', 1:11);
set(gca,'XTickLabel',120:130);
surf(120:130,0.10:0.1:1.0,resultsD000R1)
xlabel('Mass point (GeV)');
ylabel('Signal fraction');
zlabel('-ln(L)');

figure(2); % Plot of mass only
hold on;
%set(gca,'yLim',[0.1 1]);
%set(gca,'xLim',[0 11]);
%set(gca,'XTick', 1:11);
%set(gca,'XTickLabel',120:130);
xlim([120 130]);
%ylim([150 450]);
scatter(120:130,mean(resultsD000R1(:,:)),'db','filled')
xlabel('Mass point (GeV)');
ylabel('-ln(L)');
ms=120:130;
a0=polyfit(ms(3:10),mean(resultsD000R1(:,3:10)),2);
xpoints=122.5:0.1:127.5;
plot(xpoints,quadraticFunc(xpoints));
[min, minval] = fminunc(myfun3,125)

figure(3); % Plot of ratio only
hold on;
%set(gca,'yLim',[0.1 1]);
%set(gca,'xLim',[0 11]);
%set(gca,'XTick', 1:11);
%set(gca,'XTickLabel',120:130);
xlim([0.1 0.9]);
xs=0.10:0.1:1.0;
scatter(xs,mean(resultsD000R1(:,:)'),'dr','filled');
xlabel('Signal ratio');
ylabel('-ln(L)');

%a0=polyfit(xs(8:19),mean(resultsD000R1(8:19,:)'),2);
xpoints=0.20:0.003:0.8;
plot(xpoints,quadraticFunc(xpoints),'r');



[min, minval] = fminunc(myfun3,0.56)